Skip to content

Conversation

@aloisklink
Copy link
Contributor

Fixes a regex that was incorrectly breaking up '\r\n'/CRLF/␍␊ line-breaks (commonly used in Windows OSes) to just plain '\r'. And it seems like the YAML library we're using: https://www.npmjs.com/package/yaml seems to not register just \r as a line-break (although the YAML Spec v1.2.2 § 5.4 Line Break Characters does seem to say that either \r, '\n' or '\r\n' can be used as a line break).

On Windows, files are normally checked-out with git config core.autocrlf true, which will replace '\n'/LF/␊ chars with '\r\n'/CRLF/␍␊ chars. We should also handle this in our unit tests, otherwise tests will fail on Windows.

On Windows, lines usually end with `\r\n`/CRLF/␍␊.

Although YAML supports this as a line-break, our regex was incorrectly
breaking this up, which was causing the `\r` character to be appending
into some strings, instead of `\r\n`.
On Windows, files are normally checked-out with
`git config core.autocrlf true`, which will replace `'\n'`/LF chars
with `'\r\n'`/CRLF chars. We should handle this in our unit tests,
otherwise tests will fail on Windows CI.
Updates the newly created `packages/cli/CHANGELOG.md` file.
@aloisklink aloisklink added the bug Something isn't working label Apr 23, 2024
@aloisklink aloisklink requested a review from jgreywolf April 23, 2024 06:24
@vercel
Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
office-plugin-site ⬜️ Ignored (Inspect) Apr 23, 2024 6:24am

@aloisklink aloisklink merged commit 5e20ece into main Apr 23, 2024
@aloisklink aloisklink deleted the fix/fix-CRLF-windows-issue branch April 23, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants